package com.hsd.whb.utils;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class MenusUtil {

    public static Map firstLevel(String url, String icon, String name) {
        Map map = new HashMap<>();
        map.put("url", url);
        map.put("icon", icon);
        map.put("name", name);
        return map;
    }

    public static Map secondLevel(String url, String icon, String name, List list) {
        Map map = firstLevel(url, icon, name);
        map.put("childMenu", list);
        return map;
    }

    public static List<Map> generateRecorderMenus(String contextPath) {
        List<Map> firstArray = new ArrayList();
        List<Map> secondArray = new ArrayList();
        secondArray.add(MenusUtil.firstLevel(contextPath + "/recorder/fileRecordList", "", "会议记录列表"));
        secondArray.add(MenusUtil.firstLevel(contextPath + "/recorder/addFileRecord", "", "添加会议记录"));
        secondArray.add(MenusUtil.firstLevel(contextPath + "/recorder/stayOpenFileRecordList", "", "待开会议列表"));

        firstArray.add(MenusUtil.secondLevel(null, "fa fa-file-word-o", "会议记录管理", secondArray));
        firstArray.add(MenusUtil.firstLevel(contextPath + "/function/participateList", "fa fa-user", "会议参与人管理"));
        return firstArray;
    }

    public static List<Map> generateManagerMenus(String contextPath) {
        List<Map> firstArray = new ArrayList();

        firstArray.add(MenusUtil.firstLevel(contextPath + "/manager/fileRecordList", "fa fa-file-word-o", "会议记录管理"));
        firstArray.add(MenusUtil.firstLevel(contextPath + "/manager/recorderList", "fa fa-user", "记录员管理"));
        firstArray.add(MenusUtil.firstLevel(contextPath + "/manager/deviceList", "fa fa-certificate", "设备管理"));
        firstArray.add(MenusUtil.firstLevel(contextPath + "/function/participateList", "fa fa-user", "会议参与人管理"));

        return firstArray;
    }

    public static List<Map> generateRootMenus(String contextPath) {
        List<Map> firstArray = new ArrayList();
        firstArray.add(MenusUtil.firstLevel(contextPath + "/root/deviceList", "fa fa-certificate", "设备管理"));
        return firstArray;
    }
}
